From af71f48393b6faaeb05627650ef65f604ea58837 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Fri, 2 Dec 2005 16:26:57 +0100 Subject: [PATCH] More console-related cleanups. Signed-off-by: Keir Fraser --- .../arch/xen/i386/kernel/smp.c | 10 ++-------- .../arch/xen/x86_64/kernel/smp.c | 8 +------- .../drivers/xen/console/console.c | 20 ++++++++++--------- .../drivers/xen/console/xencons_ring.c | 3 ++- 4 files changed, 16 insertions(+), 25 deletions(-) diff --git a/linux-2.6-xen-sparse/arch/xen/i386/kernel/smp.c b/linux-2.6-xen-sparse/arch/xen/i386/kernel/smp.c index 115869898a..9c3a0d534e 100644 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/smp.c +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/smp.c @@ -28,8 +28,6 @@ #endif #include -#define xxprint(msg) HYPERVISOR_console_io(CONSOLEIO_write, strlen(msg), msg) - /* * Some notes on x86 processor bugs affecting SMP operation: * @@ -542,9 +540,7 @@ static void stop_this_cpu (void * dummy) */ cpu_clear(smp_processor_id(), cpu_online_map); local_irq_disable(); -#if 1 - xxprint("stop_this_cpu disable_local_APIC\n"); -#else +#if 0 disable_local_APIC(); #endif if (cpu_data[smp_processor_id()].hlt_works_ok) @@ -561,9 +557,7 @@ void smp_send_stop(void) smp_call_function(stop_this_cpu, NULL, 1, 0); local_irq_disable(); -#if 1 - xxprint("smp_send_stop disable_local_APIC\n"); -#else +#if 0 disable_local_APIC(); #endif local_irq_enable(); diff --git a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/smp.c b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/smp.c index 978ae5cf51..0e6ee3c72b 100644 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/smp.c +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/smp.c @@ -31,8 +31,6 @@ #ifdef CONFIG_XEN #include -#define xxprint(msg) HYPERVISOR_console_io(CONSOLEIO_write, strlen(msg), msg) - #else /* * Smarter SMP flushing macros. @@ -379,8 +377,6 @@ void smp_stop_cpu(void) local_irq_disable(); #ifndef CONFIG_XEN disable_local_APIC(); -#else - xxprint("stop_this_cpu disable_local_APIC\n"); #endif local_irq_enable(); } @@ -409,9 +405,7 @@ void smp_send_stop(void) spin_unlock(&call_lock); local_irq_disable(); -#ifdef CONFIG_XEN - xxprint("stop_this_cpu disable_local_APIC\n"); -#else +#ifndef CONFIG_XEN disable_local_APIC(); #endif local_irq_enable(); diff --git a/linux-2.6-xen-sparse/drivers/xen/console/console.c b/linux-2.6-xen-sparse/drivers/xen/console/console.c index 22f18b1511..292d4beaad 100644 --- a/linux-2.6-xen-sparse/drivers/xen/console/console.c +++ b/linux-2.6-xen-sparse/drivers/xen/console/console.c @@ -134,19 +134,21 @@ static struct tty_driver *xencons_driver; static void kcons_write( struct console *c, const char *s, unsigned int count) { - int i; + int i = 0; unsigned long flags; spin_lock_irqsave(&xencons_lock, flags); - - for (i = 0; i < count; i++) { - if ((wp - wc) >= (wbuf_size - 1)) - break; - if ((wbuf[WBUF_MASK(wp++)] = s[i]) == '\n') - wbuf[WBUF_MASK(wp++)] = '\r'; - } - __xencons_tx_flush(); + while (i < count) { + for (; i < count; i++) { + if ((wp - wc) >= (wbuf_size - 1)) + break; + if ((wbuf[WBUF_MASK(wp++)] = s[i]) == '\n') + wbuf[WBUF_MASK(wp++)] = '\r'; + } + + __xencons_tx_flush(); + } spin_unlock_irqrestore(&xencons_lock, flags); } diff --git a/linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c b/linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c index ea7bfe4e22..1f97c77657 100644 --- a/linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c +++ b/linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c @@ -15,6 +15,7 @@ #include #include +#include #include #include #include @@ -96,7 +97,7 @@ int xencons_ring_init(void) xen_start_info->console_evtchn, handle_input, 0, "xencons", NULL); if (err <= 0) { - xprintk("XEN console request irq failed %i\n", err); + printk(KERN_ERR "XEN console request irq failed %i\n", err); return err; } -- 2.30.2